package com.seecen.controller;

import com.seecen.common.BaseResponse;
import com.seecen.common.PageRequest;
import com.seecen.pojo.entity.Evaluation;
import com.seecen.service.EvaluationService;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/evaluation")
public class EvaluationController {

    @Autowired
    private EvaluationService evaluationService;

    // 获取所有评价列表（不依赖服务ID）
    @GetMapping("/list/all")
    public BaseResponse<?> getAllEvaluations(PageRequest pageRequest) {
        return evaluationService.getAllEvaluations(pageRequest);
    }




    // 检查订单是否已评价
    @GetMapping("/check/{orderId}")
    public BaseResponse<?> checkOrderEvaluation(@PathVariable Long orderId) {
        return evaluationService.checkOrderEvaluation(orderId);
    }
}